package com.xquant.trade.account.mapper;

import com.xquant.trade.account.entity.Account;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface AccountMapper {


    List<Account> querySelfAccountNoPermByPage(Map map);
    List<Account> querySelfAccountDeptPermByPage(Map map);

    List<Account> querySelfAccountUserPermByPage(Map map);

//    List<Account> querySelfAccountCombox(Map map);

    List<Account> queryPartyAccountByPage(Map map);

    Map getDept(Map map);

    int addAccount(Account account);

    void updateAccount(Account account);

    void deleteAccount(Account account);


    List<Map> queryAccountUser(Map map);

    List<Map> queryAccountDept(Map map);

    void saveAccountUser(Map map);
    void saveAccountDept(Map map);


    void updateAccountUser(Map map);
    void updateAccountDept(Map map);

    void updateConfigUserAuthor(Map map);


    List<Map> queryPartyAccout(Map map);


    void deleteAccountUser(Map map);

    void deleteAccountDept(Map map);

    Account checkAccName(String accName);
    Account checkAccCode(String accCode);

    void batchUpdateUserPerm(@Param("list") List<Account> list,@Param("accId")  String accId);
    void batchInsertAccUser(@Param("list")  List<Account> list);
    void batchUpdateDeptPerm(@Param("list")  List<Account> list,@Param("accId") String accId);
    void batchInsertAccDept(@Param("list")  List<Account> list);

    List<String> getUserPermUserId(Map<String, Object> param);

    List<String> getDeptPermDeptId(Map<String, Object> param);

    int removeUserPermAccount(Map param);

    int removeDeptPermAccount(Map param);

    int deleteAccUser(Account account);
    int deleteAccDept(Account account);

    int removeUserPermAccountByUserId(Map param);
    int removeDeptPermAccountByDeptId(Map param);

    String queryAccFlagByUserId(String userId);

    int updateDeptPermAccount(Map param);



}
